Outline for INF-42 Written Midterm Exam
I have collected together in this one handout the list of topics that we
have covered in the first half of INF-42.
This list is quite extensive (it is quite astounding how much material we
have covered) and contains 21 major topics.
There is no way that I can ask questions covering each of these individually
(although some questions may involve multiple topics); likewise, there is
no way that you can learn all this material starting now (I'm assuming that
you've been learning it during the entire quarter).
Therefore, you should concentrate on reviewing the most important analysis
and synthesis skills that we have studied.
Use the quizzes, the programming assignments, and programming exams as a guide
for what material is of primary importance.
Understand the material on its own terms, and how to use this material when
writing code.
Certainly using and writing classes has been the central theme
of the first half of this course, which involves knowing how to use all of
Java's control structures and arrays.
My written exams are not designed to determine if you understand obscure
material; instead, they are designed to determine if you understand
important material, and can use your knowledge to understand and answer
questions quickly.
My exams are long (some students will not finish them): it you don't
immediately know the answer to a question, skip it, and come back to it
later, if you have time (sometimes working problems later in the exam will
remind you of something relevant to the answer to earlier questions).
Outline of Lecture Topics
- Software
- General Aspects of Software: Development & Costs
- EBNF
- Understanding EBNF rules and descriptions: sequence, option, alternative repetition
- Reading EBNF rules and classifying symbols
- Determining whether EBNF descriptions are equivalent
- Examining exemplars and writing EBNF rules that classify them accordingly
- Translating between EBNF rules and EBNF diagrams
- Tokens
- Understanding how Java reads and tokenizes programs
- Tokens: Identifiers, Keywords, Separators, Operators, Literals, Comments
- The syntax of literals: int, double, boolean, char, String
- Variables and Operators
- Understanding variable declarations (drawing pictures)
- Reading and writing prototypes; operator terminology
- The prototypes and semantics of common Java operators
(arithmetic, textual, relational, logical, state-change)
- Implicit conversion
- Methods for mathematical functions and standard input/output
- Expressions
- Understanding how to form and evaluate expressions
- Analyzing expressions for correctness and meaning with oval diagrams
- Operator Precedence and Association Rules
- Casting (explicit conversion)
- Translating formulas (or English descriptions) to expressions
(with no redundant parentheses)
- Statements I
- Local variable declaration statements
- Expression statements
- Block statements (and the scope of local variable declarations)
- Understanding statements with boxing
- Trace tables to illustrate state changes in statement sequences
- Statements II
- if statements
- for statements
- break statements
- General for, while, and do/while statements
- Understanding statements with boxing
- Compact trace tables to illustrate execution of statements
- try-catch statements (simple uses; for prompting, with TypedBufferReader)
- Program Composition and Debugging
- Program synthesis via iterative enhancement
- Testing
- Debugging syntax errors
- Debugging execution errors
- Using the Eclipse debugger: viewing state, execution via
single stepping/[conditional] breakpoints
- More Java/Coding Style
- Constants via final
- Conditional Operators
- Short-Circuit Operators
- Good Names, Alignment, Locality, Comments
- Simplification
- Equivalence vs. Simplification
- Proving boolean expression equivalence and truth tables
- DeMorgan's law (and negating relational operators)
- Proving Arithmetical/Relational expressions equivalent and the law of trichotomy
- Changing the order of statements: proofs (stores/examines)
- if equivalences (test-reversal, bottom/top factoring): proofs (modified truth tables)
- Simple loop equivalences
- Class and Object Concepts
- Illustrating reference variables (drawing pictures)
- Dual-State: state of variable and state of object referred to
- The semantics of the = , == , and != operators on references
- The == operator vs. the .equals method
- Calling methods using variables referring to objects
- Reading Classes
- Class members: constructors, methods (accessors/mutators), and fields
- Definitions and access modifiers: public/private, static
- Using constructors
- Calling methods
- Why using instance variables is not important (most are private)
- Reading Javadoc
- Packages: how to import/use classes defined in packages
- Classes with have studied and used: Math, Prompt,
String, BigInteger, DiceEnsemble,
StringTokenizer, Timer,
- File I/O Classes
- TypedBufferReader/Writer constructors and methods
- Patterns for file reading (for and try/catch) and writing
- Error detection (exception handling)
- Error correction
- Static Methods
- Definitions (including parameter/argument terminology)
- The return statement
- Hand simulation via call frames (primitive and reference variables)
- Constant/final parameters
- Writing Static Methods in Classes
- The main method
- Writing methods in applications
- Writing methods in libraries (like SUM)
- Throwing exceptions with String arguments indicating the problem:
e.g., IllegalArgumentException, IllegalStateException
- Eclipse tools (editor/debugger) and their connection to static
methods
- Writing Classes
- Defining constructors, methods, fields
- Name conflicts (between parameters/locals and instance variables) and
the meaning and uses of this.
- Writing constuctors (name conflicts, the special use of this)
- Writing methods (illustrating this, the implicit parameter, in
call frames)
- Defining fields: instance variables vs. static fields; initialization of
both
- Eclipse tools (editor/debugger) and their connection to methods/instance
variables
- Array Classes
- Declaring arrays and constructing array objects
- Accessing arrays: members via subscripting ([]) and the
length instance variable
- Processing arrays: for loops and variants
- How Strings are like arrays (e.g., length and charAt
methods
- Methods processing arrays; arrays as arguments/parameters to methods
- Drawing array objects
- Eclipse tools (debugger) and its connection to arrays
- Arrays in Classes
- non-filled arrays: the top/rear/used instance
variable; the doubleLength/trim) methods
- Processing non-filled arrays in methods: scanning, rearranging members
- Implementing Collections via Arrays in Classes
- Collections in general
- Stacks and LIFO processing (RPN calculators)
- Queues and FIFO processing
- Interfaces
- Interfaces are types; how they are declared
- How classes implement interfaces
- Calling methods on variables whose types are interfaces
- Simple uses: filters in prompting, functions to integrate
- Storing "interfaces" (really, objects constructed from classes
implementing interfaces) in instance variables
- Generalizing Collections: The Object class
- The Object class
- Wrapper classes and the Object class
- Reference casting
- The instanceof operator
- An RPN Calculator using Stack
- Sequences (from programming assignment #5)
- Drawing complicated objects (whose instance variables are reference to
other objects).